package com.weipai.education.dao;

import com.weipai.education.model.Purchase;
import com.weipai.education.model.PurchaseDetail;
import com.weipai.education.model.api.Response;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/13 09:58
 */
public interface PurchaseDao {
    int insert(Purchase purchase);

    List<Map<String,Object>> list(Integer start, Integer size, String startTime, String endTime, 
                                  String key, String userId, String type, String status);

    Integer listAmount(String startTime, String endTime, String key, String userId, String type, String status);

    Purchase selectByPrimaryKey(String id);

    List<PurchaseDetail> getGoodsBarCodeByPurchaseNumber(String purchaseNumber);

    Purchase getPurchaseByPurchaseNumber(String purchaseNumber);

    int updateByPrimaryKeySelective(Purchase purchase);

    Map<String,Object> getPurchaseInfo(String purchaseNumber);

    List<Map<String,Object>> getWeekPurchase(Integer start, Integer size, String userId);

    List<Map<String,Object>> getMonthPurchase(Integer start, Integer size, String userId);

    List<Map<String,Object>> getDayPurchase(String userId);

    Integer getWeekPurchaseAmount(String userId);

    Integer getMonthPurchaseAmount(String userId);

    Response verifyGoodsBarCodes(String productId, String goodsBarCodes);

    void insertProductDetail(PurchaseDetail purchaseDetail);

    Map<String,Object> getPurchaseDetail(String purchaseNumber, String goodsBarCode);

    Integer getDayPurchaseAmount(String userId);

    Map<String,Object> getAllAmount(String userId);

    List<Map<String,Object>> cityLevelList(Integer start, Integer size, String startTime, String endTime, String key, List<Integer> idList);

    Integer cityLevelListAmount(String startTime, String endTime, String key, List<Integer> idList);

    Response verifyGoodsBarCodesIsUse(String productId, String goodsBarCodes);

    Map<String,Object> searchOrderByOrderNumber(String OrderNumber,Integer userId);

    //根据订单号和货号搜有没有这个订单
    Integer selectBarcodeByOrderNumber(String BarCode,String OrderNumber);
    //根据订单号搜这个订单的条码
    List<Map<String,Object>> getAllGoodsBar(String orderNumber);
}
